package com.baogu.factoryjob.service.impl;

import com.baogu.factoryjob.mapper.TerminalWarningMapper;
import com.baogu.factoryjob.service.TerminalWarningService;
import com.baogu.model.job.TerminalWarning;
import com.baogu.model.job.where.TerminalCollectionWhere;
import com.baogu.model.job.where.TerminalWarningWhere;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TerminalWarningServiceImpl implements TerminalWarningService {
    @Override
    public int saveTerminalWarning(TerminalWarning terminalCollection) {
        return terminalWarningMapper.insertSelective(terminalCollection);
    }

    @Override
    public int saveLastTerminalWarning(TerminalWarning terminalCollection) {
        return terminalWarningMapper.insertSelectiveLast(terminalCollection);
    }

    @Override
    public List<TerminalWarning> getNewTerminalWarningData(TerminalWarningWhere where) {
        return terminalWarningMapper.selectLastData(where);
    }

    @Override
    public int saveDateLastData(TerminalWarning terminalCollection) {
        return terminalWarningMapper.insertSelective(terminalCollection);
    }

    @Override
    public void deleteLastDate(String id) {
        terminalWarningMapper.deleteLastByPrimaryKey(id);
    }

    @Override
    public void delLast(TerminalWarningWhere where) {
        terminalWarningMapper.delLast(where);
    }

    @Override
    public void del(TerminalWarningWhere where) {
        terminalWarningMapper.del(where);
    }

    @Autowired
    TerminalWarningMapper terminalWarningMapper;
}
